//
//  YZPigDocHealthDetailReamrkCell.m
//  VET
//
//  Created by YZ on 2018/7/30.
//  Copyright © 2018年 YZ. All rights reserved.
//

#import "YZPigDocHealthDetailReamrkCell.h"
#import "YZPlaceholderTextView.h"

@interface YZPigDocHealthDetailReamrkCell()

@property (nonatomic, strong) YZPlaceholderTextView *textAreaView;

@end

@implementation YZPigDocHealthDetailReamrkCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if(self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]){
        self.layer.masksToBounds = YES;
        [self.contentView addSubview:self.textAreaView];
        
        [self makeContraints];
    }
    return self;
}

- (void)makeContraints
{
    [self.textAreaView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.top.mas_equalTo(0);
        make.height.mas_equalTo(kCurrentDeviceNum(75));
        make.bottom.equalTo(self.contentView);
    }];
}
#pragma mark -- setters && getters

- (YZPlaceholderTextView *)textAreaView
{
    if(!_textAreaView){
        _textAreaView = [YZPlaceholderTextView new];
        _textAreaView.editable = NO;
        _textAreaView.font = kCurrentDeviceFont(16);
        _textAreaView.textColor = kColorWithHex(0x7A7A7A);
        [_textAreaView setPlaceholderFont:kCurrentDeviceFont(16)];
    }
    return _textAreaView;
}

- (void)setModel:(YZPigDocHealthDetailInfoModel *)model
{
    _model = model;
    if (model.content.length > 0) {
        self.textAreaView.text = model.content;
    }else
    {
        self.textAreaView.text = @"暂无备注";
    }
    
}
@end
